<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterTableArticleRecommendAddContentTypeAndEffectiveType extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('article_recommend', function (Blueprint $table) {
            $table->unsignedTinyInteger("contentType")->default(1)->after("type")->comment('内容类型 1 - 文章 2 - 专题');
            $table->unsignedTinyInteger("effectiveType")->default(1)->after("isActivate")
                  ->comment('生效方式 1 - 限时 2 - 永久有效');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('article_recommend', function (Blueprint $table) {
            $table->dropColumn(["contentType", "effectiveType"]);
        });
    }
}
